import leaflet from "leaflet";
var esri = require("esri-leaflet");

class LayerINS {
    constructor(map, params) {
        this.layer = this[params.type](params)
        if (params.zIndex) {
            this.layer.setZIndex(params.zIndex)
        }
    }
    vector({ url }) {
        return esri.dynamicMapLayer({ url, f: "json" })
    }
    image({ url }) {
        return leaflet.tileLayer(
            url,
            {
                maxZoom: 17,
                minZoom: 5,
                zoomOffset: 1,
            }
        )
    }
}
export default LayerINS